package com.example.myblog.result;

public enum BaseCodeEnum implements BaseError{
    PARAMETER_ERROR(1,"参数不合法"),
    USER_EXISTS(2,"用户已存在"),
    USER_NOT_EXISTS(3,"用户不存在"),
    PASSWORD_ERROR(4,"密码输入错误"),
    INSERT_FAILED(5,"新增失败"),
    UPDATE_FAILED(6,"更新失败"),
    DELETE_FAILED(7,"删除失败"),
    HAS_LIKED(8,"已经点赞过"),
    BAD_REQUEST(400,"参数输入错误"),
    NO_AUTH(401,"无权访问"),
    NO_MESSAGES(446,"没有消息"),
    NO_COMMENTS(445,"没有评论"),
    NO_BLOGS(444,"没有文章"),
    NO_FOLLOWS(447,"关注列表为空"),
    NOT_FOUND(404,"未找到该资源"),
    INTERNAL_SERVER_ERROR(500,"服务器内部错误"),
    SERVER_BUSY(503,"服务器忙碌中"),
    USER_ACCOUNT_NOT_FOUND(10001,"该用户不存在"),
    HAS_FOLLOWED(10002,"已经关注过"),
    UNFOLLOWED(10003,"没有关注过");




    private final int errorCode;

    private String errorMsg;
    BaseCodeEnum(int errorCode, String errorMsg) {
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    @Override
    public int getErrorCode() {
        return this.errorCode;
    }

    @Override
    public String getErrorMsg() {
        return this.errorMsg;
    }

    @Override
    public BaseError setErrorMsg(String message) {
        this.errorMsg = message;
        return this;
    }
}
